package cn.tedu.baking.mapper;

import cn.tedu.baking.pojo.dto.ContentManagementQueryDTO;
import cn.tedu.baking.pojo.entity.Content;
import cn.tedu.baking.pojo.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContentMapper {

    int insert(Content content);

    List<ContentManagementVO> selectForManagement(ContentManagementQueryDTO queryDTO);

    int deleteById(Long id);

    ContentUpdateVO selectForUpdateById(Long id);

    int update(Content content);

    String selectImgUrlById(Long id);

    List<ContentIndexVO> selectForIndexByType(@Param("type")Integer type,
                                              @Param("categoryId") Long categoryId);

    ContentDetailVO selectForDetailById(Long id);

    List<ContentSimpleVO> selectOtherById(Long id);

    int updateViewCountById(Long id);

    List<ContentSimpleVO> selectForHot();

    List<ContentIndexVO> selectByType(Integer type);

    List<ContentIndexVO> selectByWd(String wd);

    List<ContentAdminVO> selectForAdmin();
}
